package com.xhwl.data.service;

import com.alibaba.fastjson.JSONObject;
import com.xhwl.common.pojo.cent.sdata.EnterpriseExtra;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 企业扩展信息表 服务类
 * </p>
 *
 * @author yf
 * @since 2023-02-14
 */
@RestController
public interface IEnterpriseExtraService extends IService<EnterpriseExtra> {

    String get(Integer enterpriseId, String attribute);

    void save(Integer enterpriseId, JSONObject extra);

    JSONObject list(Integer enterpriseId);

    /**
     * 通过extra获取企业ID，南飞鸿酆泽数据同步专用，extra为 “nfh-”+"租户号"+"-R/O"
     */
    @RequestMapping(value = "/enterprise-extra-service/find-by-extra", method = RequestMethod.POST)
    Integer getEnterpriseExtraByExtra(String extra);

    /**
     * 为南飞鸿酆泽数据同步专门提供的接口，添加enterpriseExtra
     */
    @RequestMapping(value = "/enterprise-extra-service/create", method = RequestMethod.POST)
    void addEnterpriseExtraForNFH(@RequestPart Integer enterpriseId, @RequestPart JSONObject extra);

    /**
     * 为南飞鸿酆泽数据同步专门提供的接口，通过企业ID 删除enterpriseExtra
     */
    @RequestMapping(value = "/enterprise-extra-service/delete-by-id", method = RequestMethod.POST)
    void deleteEnterpriseExtraById(@RequestPart Integer enterpriseId);
}
